package com.eliza.library.model

import androidx.room.ColumnInfo
import androidx.room.Entity
import androidx.room.Ignore
import androidx.room.PrimaryKey


/*-*- coding:utf-8 -*-
 * @Author  : debi
 * @Time    : 5/1/22
 * @Software: Android Studio
 */


@Entity(tableName = "Contactor")
class Contactor {
    @PrimaryKey(autoGenerate = true)
    @ColumnInfo(name = "Id", typeAffinity = ColumnInfo.INTEGER)
    var id: Int = 0

    @ColumnInfo(name = "Name", typeAffinity = ColumnInfo.TEXT)
    var name: String = ""

    @ColumnInfo(name = "Age", typeAffinity = ColumnInfo.INTEGER)
    var age: Int = 0

    @ColumnInfo(name = "TEl", typeAffinity = ColumnInfo.TEXT)
    var tel: String = ""

    @ColumnInfo(name = "Email", typeAffinity = ColumnInfo.TEXT)
    var email: String = ""

    @Ignore
    constructor(id: Int) {
        this.id = id
    }

    @Ignore
    constructor(name: String, age: Int) {
        this.name = name
        this.age = age
    }

    @Ignore
    constructor(name: String, age: Int, tel: String, email: String) {
        this.name = name
        this.age = age
        this.tel = tel
        this.email = email
    }

    constructor(id: Int, name: String, age: Int, tel: String, email: String) {
        this.id = id
        this.name = name
        this.age = age
        this.tel = tel
        this.email = email
    }

    override fun toString(): String {
        return "Contactor(id=$id, name='$name', age=$age, tel='$tel', email='$email')"
    }

}